<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CSS transition</title>
    <style>
      html,
      body {
        overflow: hidden;

        width: 100vw;
        height: 100vh;
      }
      div {
        margin-bottom: 12px;
      }
      .box {
        width: 50px;
        height: 50px;

        background-color: aqua;

        transition: all 0.4s ease;
      }
      .box:hover {
        border-radius: 50%;

        background: #e74c3c;

        transform: rotate(45deg) scale(1.2);
      }
      .timing-demo {
        display: flex;

        margin: 20px 0;

        flex-direction: column;
        gap: 10px;
      }

      .timing-box {
        margin: 5px 0;
        width: 100px;
        height: 50px;

        background: #3498db;

        transition: all 1s;
      }

      .timing-demo:hover .timing-box {
        margin-left: calc(100% - 120px);
      }

      .ease {
        transition-timing-function: ease;
      }
      .linear {
        transition-timing-function: linear;
      }
      .ease-in {
        transition-timing-function: ease-in;
      }
      .ease-out {
        transition-timing-function: ease-out;
      }
      .ease-in-out {
        transition-timing-function: ease-in-out;
      }
      .cubic-bezier {
        transition-timing-function: cubic-bezier(0.68, -0.55, 0.27, 1.55);
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
    <div class="timing-demo">
      <div class="timing-box ease">ease（默认）</div>
      <div class="timing-box linear">linear（线性）</div>
      <div class="timing-box ease-in">ease-in（渐入）</div>
      <div class="timing-box ease-out">ease-out（渐出）</div>
      <div class="timing-box ease-in-out">ease-in-out（渐入渐出）</div>
      <div class="timing-box cubic-bezier">cubic-bezier（贝塞尔曲线）</div>
    </div>
  </body>
</html>
